#ifndef MBAPPWIG_H
#define MBAPPWIG_H

#include <QWidget>
#include <QUdpSocket>
#include <QTableWidget>

namespace Ui {
class MbappWig;
}

class MbappWig : public QWidget
{
    Q_OBJECT

public:
    explicit MbappWig(QWidget *parent = 0);
    ~MbappWig();

private:
    Ui::MbappWig *ui;
    QString tempName = "00000";
    QUdpSocket *udpSocket; // UDP 套接字
    quint16 port;          // 监听端口
    void addDeviceToTable(const QString &deviceName, const QString &ip, const QString &status); // 添加设备信息到表格

private slots:
    void startSearch();   // 开始搜索
    void processPendingDatagrams(); // 处理接收到的 UDP 数据
};

#endif // MBAPPWIG_H
